package com.woniuxy.controller;

import com.woniuxy.entity.RbacRole;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.entity.RoleMenuDTO;
import com.woniuxy.service.RbacRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("rbacRole")
public class RbacRoleController {
    @Autowired
    RbacRoleService rbacRoleService;
    @RequestMapping("findAll/{currentPage}/{pageSize}")
    public ResponseEntity findAll(@PathVariable int currentPage, @PathVariable int pageSize, @RequestBody RbacRole rbacRole){
        return   rbacRoleService.findAll(currentPage,pageSize,rbacRole);
    }
    @RequestMapping("saveMenu")
    public ResponseEntity saveMenu(@RequestBody RoleMenuDTO roleMenuDTO){
        return rbacRoleService.saveMenu(roleMenuDTO);
    }
}
